let arr = [11, 22, 33];

function foreachToArr() {
    for (let temp of arr) {
        console.log('值', temp);
    }
}
console.log("---for (let temp of arr)循环遍历方式---");
foreachToArr();

function subscriptTraversal() {
    for (let i = 0; i < arr.length; i++) {
        console.log('值', arr[i]);
    }
}
console.log("---for (let i = 0; i < arr.length; i++)---");
subscriptTraversal();

function foreachLoop() {
    arr.forEach(x => {
        console.log('值', x);
    });
}
console.log("---arr.forEach---");
foreachLoop();